package edu.nf.bs.util;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117682039";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQCjZSGA36AyNA+3snBLa6Zg2i9NTgBqZlHmV3P878O09Kk+P07g6EABS7RKT0Z8nc0NkjKjCn7DbBRP0hLRvPkJzE0csqLaYSfq88TRJT3BF09g0yJwX1hK5uIIwg/3GZwdjM/GfS9A8g2dyR11djnJo+p0r6hZsAUSP8pzch/m6o2c95oK46saGJlkdMX8ZuVQK7FNLEjfON7YtlSm/WpEqSeMEXpN5kJzQyp57s/8R9TJ2THMmClR5rI5HQZ7ju4sXITgXBy0RcJvGzA+9O0sOye2TrD0uH4uSt9PqZoE07ZKkdNVynVGZnW5eQKHBx7FYxEQGlAjYZAAn+mglQgxAgMBAAECggEBAJd7j+ch7Cv/Fj9RYEicAgEy5r29vibmu7FYjMEILKHcXffGy8M5rvVEkV5/RrMLvWqCiw2bElDtJ5ulACuRDjWmQiuD9fWOM2rhGyxnYWxdxwrWU8xoqLuweAh0mkaVaKYAwTSdJK0Ke9M3/GbE9+hYXmpV3DdiOCFmILSNLsRuWRRiF2kpIhfFoY7Qn6dNU2RoVDKsCe2xjkiBBzfYnM8S6lQ7xwTD/LCFyQM68wmJHj41u9FEQDwsUx4FV4GJ5AyXNSjP41Ywfa4Lq5GoY0r8Is3dvY3olQq5pOpNCYRNmDz7yd76WHQg5CCerxyVo2fp9u0ZyP+mm+EKv40dxsECgYEA9I4vnxmzZyK/7QEmtWX3ApCEUSSntBa0zKf/s5l98CLp/Ht1qBX1V4+TAPv1DngnVkPZ3knH3qK2lrQe0Dsgn/uSJ7L5iCG54VLYEFnR2iFWGSLTg4ByTbqYD7ai6wo/5O74rMFfkGF0PhOeIut4agXGuCYOEFbTvp5jA5miwokCgYEAqwqhWltkgYcyNUp93QzPy8DSdGqILUdfyAsOpcSck3fW83O3Dijpd2UHMO7ON9NP80hrShgXzIR4btVLLN+MCnioJODQutRZ/DVhffC1BGhwKYMcJK3iCrye3LXB2+IqKT8IEGJ8/RxazgIXMXOAg/WmWtBvnepYGXWGJ2PBzmkCgYEAhR20LD0YG0aeA8sBn/HNn3a8n1J9eph1d4TmuYMOOx02Ejm9lG3Haw76rKl4/ZRHjTxHpiixA628B5Ipx5y3qH2OU8+m5gO9ozmt5FCP2tUUgYAkc8sB7O9pf/wg+CFPIDU35QkpFHUHihaxmD5mAAf+4BPOyfQJNBQQv0/seUkCgYEAmH720zfOyUl/s1HCHBazIee9+7uLxErxk8p/+b3tF/Ht/Mr7t600UpYJrlAMHmvRyYeU2M/YUCj/s1mKF+0Lz745s/+ZOingPORfEslMqyxubCSQMAe0FHyNaxzGRcREcNfY2brl00m3kBr/EMD5IS4gbrGOAo6Qk8pbnLzta5kCgYEA269rGYn8LPlk/+q0f9nvhf4uFrblbdkIiOu3ICL2Cl87HaiimAHxY94fKG4cX7ay5TAWVhbIsXhLdjXYPlqL85qLnVWbqsxaZdR3XHvnid0y6QJaOnsO8OInPQObnNjTNccoimvEcgsdkIJkUzpXeempBC1NlPhQpFpGX+mQpDU=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtXdjDkil7XZNih860BbKTOX264+kmcFfEJcYr9GwN8J4wR6mCEKh3p07caULL7ae6T6IHpJQxWVPK4wBqgB163r2AChoqbOjVDezjGwOICXzJlK2n1fO941XbJ5AfEZhTb2XA9u40l5rW8wmnVHsEmREsQ65rFCgHvv0eUfpXPvomD9YsTB8E9OYzRSg2smh37MoWRuuOhUkm1YVWfGKiVZX7bP51ZFazrUbLXF1RuK6eDJGFZZA8aGbIe/MFIqw/QhGKIF7XqMUU5UBQ8nMHPPp+8nIli5zDgUBMF+1K9BCRlEwjPOP1Ks/84rdowjLp6SMPzU5cBWHaVtU0LkhRQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://127.0.0.1:5500/exp/success.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
